convert long to date in java

53

convert long to date in java -

//The Date constructor (click the link!) accepts the time as long in milliseconds, not seconds.
long currentDateTime = System.currentTimeMillis();
//creating Date from millisecond
Date currentDate = new Date(currentDateTime);

Comments

Submit
0 Comments